﻿

using IotContract.Dtos.Servers.Process;
using IotContract.Dtos.Servers.Pushs;
using IotContract.Enums;
using IotContract.Models.Clients.Hks;
using IotContract.Models.Fmts;
using IotContract.Models.Plcs;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HbcServerProcess.Interfaces;
public interface IProcessDataService
{
    /// <summary>
    /// 推送的扫码枪
    /// </summary>
    /// <returns></returns>
     ConcurrentDictionary<int, List<PushBcrDto>> Bcrs { get; set; }
    /// <summary>
    /// 物流线数据
    /// </summary>
     ConcurrentDictionary<int,CvUnitTagDto> CvUnitTags { get; set; }
    /// <summary>
    /// 堆垛机数据
    /// </summary>
    ConcurrentDictionary<int,ScUnitDto> ScUnits { get; set; }
    /// <summary>
    /// 充放电设备数据
    /// </summary>
   List<PushHkOcvFmtDto> Fmts { get; set; }
    /// <summary>
    /// 杭可预约信息
    /// </summary>
    ConcurrentDictionary<string, HkWriteInstruct> HkFMTAppointDic { get; set; }
    /// <summary>
    /// ECS设备状态数据,按照类型分组
    /// </summary>
    ConcurrentDictionary<IotEquipType, ConcurrentDictionary<int, EquipWarnStatus>> EcsEquipWarnDic { get; set; }

    /// <summary>
    /// 设备状态远程发送队列
    /// </summary>
    public ConcurrentQueue<RemoteEquipStatus> EquipStatusQueue { get; set; }

    /// <summary>
    /// 设备报警远程发送队列
    /// </summary>
    public ConcurrentQueue<RemoteEquipWarn> EquipWarnQueue { get; set; }
   

    /// <summary>
    /// 写入Cv点位数据
    /// </summary>
    /// <param name="equipTag"></param>
    /// <returns></returns>
    Task<bool> WriteCvData(PushEquipTag equipTag);
    /// <summary>
    /// 写入Ecs CV数据
    /// </summary>
    /// <param name="data"></param>
    /// <returns></returns>
    Task<string> WriteCvAddr(EcsCvWrite data);
    /// <summary>
    /// 写入OcvFmt
    /// </summary>
    /// <param name="instruct"></param>
    /// <returns></returns>
    Task<string> WriteOcvFmtAddr(HkWriteInstruct instruct);
    /// <summary>
    /// 写入HK指令,第三方调用入口
    /// </summary>
    /// <param name="datas"></param>
    /// <returns></returns>
    Task<string> AddHkInstructs(List<HkWriteInstruct> datas);
    /// <summary>
    /// 写入
    /// </summary>
    /// <param name="addr"></param>
    /// <returns></returns>
    Task<string> WriteScAddr(ScUnitDto sc, PlcSCAddr addr);

    /// <summary>
    /// 重置扫码
    /// </summary>
    /// <param name="unitTag"></param>
    /// <param name="isAll">是否清除旧托盘</param>
    void ClearBcr(CvUnitTagDto unitTag, bool isAll = true);

    /// <summary>
    /// 读取 扫码枪
    /// </summary>
    /// <param name="unit"></param>
    /// <exception cref="NotImplementedException"></exception>
    Task<bool> ReadBcr(CvUnitTagDto unitTag);

    
}
